Use case: SDIO extended polling transfer

Extended polling transfers use HAL_SDIO_WriteExtended() and HAL_SDIO_ReadExtended() in blocking mode. The APIs remain unchanged between HAL1 and HAL2. For example, an SDIO Wi‑Fi device may expose multiple functions where user_io_func_nbr selects the Wi‑Fi function; an extended transfer could then transfer a TCP/IP packet in the Wi‑Fi function.

@startuml
hide footbox
participant "User Application" as part1
participant "HAL SDIO" as part2
activate part1
activate part2

group Extended polling I/O access
part1->part2 : HAL_SDIO_WriteExtended()
part2-->part1 : HAL Status
part1->part2 : HAL_SDIO_ReadExtended()
part2-->part1 : HAL Status
end
@enduml

Code Snippet

HAL1/HAL2

/* Write BufferSize bytes to function user_io_func_nbr
    at address IoAddress using Extended polling */
if (HAL_SDIO_WriteExtended(&hsdio,
                           user_io_func_nbr,
                           Write_IoAddress,
                           Buffer_Tx,
                           BufferSize,
                           TimeoutMs) != HAL_OK)
{
    Error_Handler();
}

/* Read BufferSize bytes from function user_io_func_nbr
    at address IoAddress using Extended polling */
if (HAL_SDIO_ReadExtended(&hsdio,
                          user_io_func_nbr,
                          Read_IoAddress,
                          Buffer_Rx,
                          BufferSize,
                          TimeoutMs) != HAL_OK)
{
    Error_Handler();
}